import request from "@/utils/request";


export function getAllAccountList(params = {}){
  return request({
    url: '/account/getAllAccountList',
    method: 'get',
    params,
  })
}

export function getAccountList(params = {}){
  return request({
    url: '/account/getAccountList',
    method: 'get',
    params,
  })
}

/**
 * 修改店铺信息
 * @param data
 * @returns {Promise<unknown>}
 */
export function editAccount(data){
  return request({
    url: '/account/editAccount',
    method: 'post',
    data,
    handleError: true,
  })
}

/**
 * 获取店铺的采集进度
 * @param accountId
 * @returns {Promise | Promise<unknown>}
 */
export function getAccountPercentage(accountId){
  return request({
    url: `/account/getAccountPercentage/${accountId}`,
    method: 'get',
  })
}

/**
 * 获取店铺的采集进度
 * @param id
 * @returns {Promise<unknown>}
 */
export function getAccountPercentageV2(id){
  return request({
    url: `/account/getAccountPercentageV2/${id}`,
    method: 'get',
  })
}

/**
 * 授权falabellaAccount店铺
 * @param data
 * @returns {Promise<unknown>}
 */
export function authFalabellaAccount(data){
  return request({
    url: `/account/authFalabellaAccount`,
    method: 'post',
    data,
    handleError: true,
  })
}

/**
 * 获取falabella店铺的采集进度
 * @param id
 * @returns {Promise<unknown>}
 */
export function getFaAccountPercentage(id){
  return request({
    url: `/account/getFaAccountPercentage/${id}`,
  })
}


/**
 * 获取店铺的授权链接
 * @returns {Promise | Promise<unknown>}
 */
export function getSpAuthUrl(){
  return request({
    url: '/getSpAuthUrl'
  })
}

/**
 * 获取店铺的授权链接
 * @returns {Promise | Promise<unknown>}
 */
export function getSiAuthUrl(){
  return request({
    url: '/getSiAuthUrl'
  })
}

/**
 * 获取店铺的授权链接
 * @returns {Promise | Promise<unknown>}
 */
export function getAwsAuthUrl(data){
  return request({
    url: '/getAwsAuthUrl',
    method: 'post',
    data,
    handleError: true,
  })
}

/**
 * 获取店铺的授权链接
 * @returns {Promise | Promise<unknown>}
 */
export function getTikTokUSAuthUrl(){
  return request({
    url: '/getTikTokUSAuthUrl'
  })
}


/**
 * 获取店铺的授权链接
 * @returns {Promise | Promise<unknown>}
 */
export function getTikTokAuthUrl(){
  return request({
    url: '/getTikTokAuthUrl'
  })
}

/**
 * 获取店铺的授权链接
 * @returns {Promise | Promise<unknown>}
 */
export function getAliexpressAuthUrl(){
  return request({
    url: '/getAliexpressAuthUrl'
  })
}
